package com.sun.hunk.properties;

import java.io.FileNotFoundException;
import java.io.IOException;

public class EmailProperties implements com.sun.hunk.properties.Properties {

    private static java.util.Properties prop = null;
    public static final String SMTP_HOST_NAME = "mail.smtp.host";
    public static final String SMTP_PORT = "mail.smtp.port";
    public static final String MAIL_FROM_USER = "mail.from.user";
    public static final String MAIL_FROM_PASSWORD = "mail.from.password";
    
    private static void init() {
        prop = new java.util.Properties();
        try {
            prop.load(EmailProperties.class.getResourceAsStream(EMAIL_PROPERTIES));
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * @param property
     * @return
     * Getting property from Email properties File...
     */
    public static String getProperty(String property) {
        if (prop == null) {
            init();
        }
        return prop.getProperty(property);
    }
}
